package com.tencent.sr.iris.basic.saas.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 用户任务参与进度表-奖品发放状态
 */
@AllArgsConstructor
@Getter
public enum TaskRecordAwardIssueStatusEnum {

    UNISSUED((byte) 0, "未发放"),
    ISSUE_SUCCEED((byte) 1, "发放成功"),
    ISSUE_FAILED((byte) 2, "发放失败"),
    ISSUE_UNABLE((byte) 3, "不可派奖");

    private final byte code;
    private final String desc;

    public static TaskRecordAwardIssueStatusEnum getByCode(byte code) {
        for (TaskRecordAwardIssueStatusEnum event : TaskRecordAwardIssueStatusEnum.values()) {
            if (event.getCode() == code) {
                return event;
            }
        }
        return null;
    }
}
